package com.ganmiao.server.sys.entity;

import com.baomidou.mybatisplus.annotation.IdType;
import com.baomidou.mybatisplus.annotation.TableId;
import com.baomidou.mybatisplus.annotation.TableName;
import com.ganmiao.entity.BaseColumns;
import com.ganmiao.server.sys.validated.Add;
import com.ganmiao.server.sys.validated.Update;
import io.swagger.annotations.ApiModel;
import io.swagger.annotations.ApiModelProperty;
import lombok.AllArgsConstructor;
import lombok.Builder;
import lombok.Data;
import lombok.NoArgsConstructor;

import javax.validation.constraints.NotBlank;
import javax.validation.constraints.NotNull;
import java.io.Serializable;

/**
 * 菜单信息
 *
 * @TableName sys_menu
 */
@Data
@Builder
@NoArgsConstructor
@AllArgsConstructor
@ApiModel("菜单信息")
@TableName(value = "sys_menu")
public class SysMenu extends BaseColumns implements Serializable {

    /**
     * 菜单主键ID
     */
    @TableId(type = IdType.AUTO)
    @NotNull(groups = Update.class, message = "菜单主键ID不能为空")
    @ApiModelProperty("菜单主键ID")
    private Integer menuId;

    /**
     * 菜单名称
     */
    @NotBlank(groups = {Add.class, Update.class}, message = "菜单名称不能为空")
    @ApiModelProperty("菜单名称")
    private String menuName;

    /**
     * 上级菜单ID (默认为0)
     */
    @ApiModelProperty("上级菜单ID (默认为0)")
    private Integer parentId;

    /**
     * 显示排序
     */
    @NotNull(groups = {Add.class, Update.class}, message = "显示排序不能为空")
    @ApiModelProperty("显示排序")
    private Integer menuOrder;

    /**
     * 菜单类型 (0:菜单 1:按钮)
     */
    @NotBlank(groups = {Add.class, Update.class}, message = "菜单类型不能为空")
    @ApiModelProperty("菜单类型 (0:菜单 1:按钮)")
    private String menuType;

    /**
     * 路由地址
     */
    @NotBlank(groups = {Add.class, Update.class}, message = "路由地址不能为空")
    @ApiModelProperty("路由地址")
    private String menuPath;

    /**
     * 系统编码 (supplier:供应商 purchase:采购 portal:门户 mall:商城)
     */
    @ApiModelProperty("系统编码 (supplier:供应商 purchase:采购 portal:门户 mall:商城)")
    private String sysCode;

    /**
     * 组件路径
     */
    @ApiModelProperty("组件路径")
    private String menuComponent;

    /**
     * 路由参数
     */
    @ApiModelProperty("路由参数")
    private String menuParameter;

    /**
     * 权限字符
     */
    @NotBlank(groups = {Add.class, Update.class}, message = "权限字符不能为空")
    @ApiModelProperty("权限字符")
    private String menuStr;

    /**
     * 状态 (1:正常 9:删除/失效)
     */
    @ApiModelProperty("状态 (1:正常 9:删除/失效)")
    private String status;

    /**
     * 菜单列表(0:pc 1:h5)
     */
    @ApiModelProperty("菜单列表(0:pc 1:h5)")
    private String menuList;

    /**
     * 菜单log
     */
    @ApiModelProperty("菜单log")
    private Integer menuLog;

}